/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const nestedRouter = {
    path: '/nested',
    component: Layout,
    redirect: '/nested/menu1/menu1-1',
    name: 'Nested',
    meta: {
        title: '拓展',
        icon: 'nested'
    },
    children: [
        {
            path: 'menu1',
            component: () => import('@/views/nested/menu1/index'), // Parent router-view
            name: 'Menu1',
            meta: { title: '树级菜单' },
            redirect: '/nested/menu1/menu1-1',
            children: [
                {
                    path: 'menu1-1',
                    component: () => import('@/views/nested/menu1/menu1-1'),
                    name: 'Menu1-1',
                    meta: { title: 'Menu 1-1' }
                },
                {
                    path: 'menu1-2',
                    component: () => import('@/views/nested/menu1/menu1-2'),
                    name: 'Menu1-2',
                    redirect: '/nested/menu1/menu1-2/menu1-2-1',
                    meta: { title: 'Menu 1-2' },
                    children: [
                        {
                            path: 'menu1-2-1',
                            component: () =>
                                import(
                                    '@/views/nested/menu1/menu1-2/menu1-2-1'
                                ),
                            name: 'Menu1-2-1',
                            meta: { title: 'Menu 1-2-1' }
                        },
                        {
                            path: 'menu1-2-2',
                            component: () =>
                                import(
                                    '@/views/nested/menu1/menu1-2/menu1-2-2'
                                ),
                            name: 'Menu1-2-2',
                            meta: { title: 'Menu 1-2-2' }
                        }
                    ]
                },
                {
                    path: 'menu1-3',
                    component: () => import('@/views/nested/menu1/menu1-3'),
                    name: 'Menu1-3',
                    meta: { title: 'Menu 1-3' }
                }
            ]
        },
        {
            path: 'menu2',
            name: 'Menu2',
            component: () => import('@/views/nested/menu2/index'),
            meta: { title: '表格增删改' }
        },
        {
            path: 'menu3',
            name: 'Menu3',
            component: () => import('@/views/nested/menu3/index'),
            meta: { title: '地址选择器' }
        },
        {
            path: 'menu4',
            name: 'Menu4',
            component: () => import('@/views/nested/menu4/index'),
            meta: { title: '树形表格' }
        },
        {
            path: 'menu5',
            name: 'Menu5',
            component: () => import('@/views/nested/menu5/index'),
            meta: { title: '未定义的功能' }
        },
        {
            path: 'menu6',
            name: 'Menu6',
            component: () => import('@/views/nested/menu6/index'),
            meta: { title: '多个表单验证功能' }
        },
        {
            path: 'menu7',
            name: 'Menu7',
            component: () => import('@/views/nested/menu7/index'),
            meta: { title: '四级地址懒加载' }
        },
        {
            path: 'menu8',
            name: 'Menu8',
            component: () => import('@/views/nested/menu8/index'),
            meta: { title: '测试' }
        },
        {
            path: 'menu9',
            name: 'Menu9',
            component: () => import('@/views/nested/menu9/index'),
            meta: { title: '事件委托' }
        },
        {
            path: 'menu10',
            name: 'Menu10',
            component: () => import('@/views/nested/menu10/index'),
            meta: { title: '测试增删改查Api' }
        },
        {
            path: 'menu11',
            name: 'Menu11',
            component: () => import('@/views/nested/menu11/index'),
            meta: { title: 'element组件' }
        }

    ]
}

export default nestedRouter
